<?php

namespace app\admins\model;

use think\Model;

class Admins extends Model
{
//    链接数据库，完成账号，邮箱，手机号登录的功能
    protected $table = 'admin';

    //完成非数据库数据不能登录的功能
    public static function login($data)
    {
        return self::where(function ($query) use ($data) {
            $query->whereOr('a_name', $data['a_name']);
            $query->whereOr('a_email', $data['a_name']);
            $query->whereOr('a_phone', $data['a_name']);
        })->where('password', md5($data['password']))->find();
    }
}